<%-- 
    Document   : viewProductStaffBody
    Created on : Nov 19, 2012, 2:32:51 PM
    Author     : tuan
--%>

<%@page import="java.util.Iterator"%>
<%@page import="java.util.Collection"%>
<%@page import="data.ProductDAL"%>
<%@page import="data.ProductEntity"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <table>
            <tr>
                <th>ProductID</th>
                <th>ProductName</th>
                <th>CategoryID</th>
                <th>UnitPice</th>
                <th>UnitsInStock</th>
                <th>UnitsInOrder</th>
            </tr>
            <%
            Collection<ProductEntity> list = ProductDAL.listAll();
            Iterator<ProductEntity> it = list.iterator();
            while(it.hasNext()){
             ProductEntity entiry = it.next();
             
%>
            <tr>
                <td><%=entiry.getProductId()%></td>
                 <td><a href="/"><%=entiry.getProductName()%></a></td>
                  <td><%=entiry.getCategoryId()%></td>
                   <td><%=entiry.getUnitPrice()%></td>
                    <td><%=entiry.getUnitsInOrder()%></td>
                     <td><%=entiry.getUnitsInStock()%></td>
            </tr>
            
            <%}%>
        </table>
    </body>
</html>
